import React,{useState} from 'react'
import ListItem from './listItem';
import { useHistory } from "react-router-dom";


const List = ()=>{
    let history = useHistory();
    
    function handleClick() {
        history.push("/home");
    }

    const [count,getCount] = useState(0)
    return(
        <div >
            <button onClick={handleClick}>重定向页面</button>
            <ListItem
                count={count}
                getCount={getCount}
            >{{name:'组件传值'}}</ListItem>
        </div>
    )

}

export default List;